import request from '@/config/axios'

export interface MaterialCollectVO {
  id: number
  productNumber: string
  productName: string
  drawingNumber: string
  specification: string
  version: string
  activeData: Date
  stopData: Date
  remark: string
  userNickName: string
}

// 查询物料清单历史列表
export const getMaterialHistoryPage = async (params) => {
  return await request.get({ url: `/config/material-collect/history-page`, params })
}

// 查询物料清单历史详情
export const getMaterialHistory = async (id: number) => {
  return await request.get({ url: `/config/material-collect/history-details?id=` + id })
}

// 新增物料清单历史
export const createMaterialHistory = async (data: MaterialCollectVO) => {
  return await request.post({ url: `/config/material-collect/create`, data })
}

// 导出物料清单历史 Excel
export const exportMaterialHistory = async (data) => {
  return await request.download({ url: `/config/material-collect/export-history-excel`, data })
}

// 导出物料清单历史详情excel
export const exportMaterialHistoryDetail = async (params) => {
  return await request.download({ url: `/config/material-collect/export-history-details-excel`, params })
}
